BIRMINGHAM | ITP-JAN 26 | Merve Reis | sprint 3 | Alarm clock #1040
BIRMINGHAM | ITP-JAN 26 | Merve Reis | sprint 3 | Alarm clock #1040mervereis wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
There was a problem hiding this comment.
What will happen if we pass an empty or negative argument as the input?
There was a problem hiding this comment.
@hkavalikas I added validation to prevent empty, invalid, or negative inputs from starting the timer.
There was a problem hiding this comment.
What will happen if I click on Set alarm multiple times? How can we improve that?
There was a problem hiding this comment.
@hkavalikas I now clear any existing interval before starting a new one so multiple clicks don’t create overlapping timers.
| let seconds = Number(document.getElementById("alarmSet").value); | ||
|
|
||
| // Update the heading to show the starting time | ||
| document.getElementById("timeRemaining").innerText = |
There was a problem hiding this comment.
We are using this DOM query in a few places, how can we improve/reuse it instead?
There was a problem hiding this comment.
@hkavalikas I assigned the timeRemaining element to a variable and reused it for avoid querying the DOM multiple times and improve code reuse.
|
Can we add a Changelist in this PR noting down the changes made? |
Added a changelist to pr description |
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
timeRemainingDOM element to avoid repeated queries